import java.io.File;


public class FileNinja extends Thread {
	boolean runInit;


	public FileNinja(){

	}
	public FileNinja(boolean rInit){
		runInit = rInit;
	}
	public void run(){
		if(runInit){
			InitFileNinja();
		}
		else{
		}
	}

	public void InitFileNinja(){
		GUI1.myProject.localFileList.clear();
		System.out.println(GUI1.myProject.getCwd().list());
		for(String s: GUI1.myProject.getCwd().list()){
			System.out.println("ninja bro" + s);
			File temp = new File(GUI1.myProject.getCwd().getPath()+ "/" + s);
			System.out.println(GUI1.myProject.getCwd().getPath());
			long size = temp.length();
			System.out.println("file size" + size);
			long hash = GUI1.myProject.adlerHash(new byte [(int) size]);
			System.out.println(hash);
			long LM = temp.lastModified();
			Server whatWhat = GUI1.myProject.getMServ();
			if (whatWhat == null) {
				System.out.println("am i null?");
			}
			FileDetails tempDeets = new FileDetails(s, hash, size, LM, GUI1.myProject.getMServ().getLocalAddr());
			GUI1.myProject.localFileList.add(tempDeets);
			System.out.println(GUI1.myProject.localFileList);
		}
	}
}

